package myky.com.doctorapp.adapter;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import myky.com.doctorapp.R;
import myky.com.doctorapp.entity.MineFragmentEntity;


/**
 * Description:
 * @author wuyang
 * Created by 2018/12/28 10:45
 */
public class MineFragmentAdapter extends BaseMultiItemQuickAdapter<MineFragmentEntity,BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public MineFragmentAdapter(List<MineFragmentEntity> data) {
        super(data);
        addItemType(MineFragmentEntity.DEFAULT,R.layout.mine_fragment_type_default);
        addItemType(MineFragmentEntity.FOOTLAYOUT,R.layout.mine_fragment_type_foot);
    }

    @Override
    protected void addItemType(int type, int layoutResId) {
        super.addItemType(type, layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, MineFragmentEntity item) {

        TextView textView= helper.getView(R.id.mine_fragment_type_item_tv);
        textView.setText(item.getText());
        switch (helper.getItemViewType()){

            case MineFragmentEntity.DEFAULT:

                break;

            case MineFragmentEntity.FOOTLAYOUT:

                break;

        }
        helper.addOnClickListener(R.id.mine_fragment_type_item);
    }
}
